var t = getApp();

Component({
    options: {
        styleIsolation: "shared"
    },
    properties: {},
    lifetimes: {
        ready: function() {
            this.init(), this._getData();
        }
    },
    data: {
        customer_open: !0,
        show1: !1,
        dataget: [],
        title: [],
        msgarr: [],
        msg: "",
        showbox: !1,
        service_QRcode: "",
        service_mobile: ""
    },
    methods: {
        init: function() {
            this.setData({
                customer_open: !0,
                show1: !1,
                service_QRcode: "",
                service_mobile: ""
            });
        },
        callPhone: function() {
            wx.makePhoneCall({
                phoneNumber: this.data.service_mobile
            });
        },
        showPop: function() {
            this.data.customer_open && this.setData({
                show1: !0
            });
        },
        closePop: function() {
            this.setData({
                show1: !1
            });
        },
        _getData: function() {
            var e = this, s = t.getNetAddresss("plugin.help-center.api.content.info");
            t._getNetWork({
                url: s,
                success: function(t) {
                    var s = t.data;
                    if (1 == s.result) {
                        console.log(s.data.customer_service.customer_open), e.setData({
                            dataget: s.data.set_data,
                            customer_open: "1" == s.data.customer_service.customer_open,
                            service_QRcode: s.data.customer_service.service_QRcode,
                            service_mobile: s.data.customer_service.service_mobile
                        });
                        var o = e.data.msgarr, a = e.data.title;
                        e.data.dataget.map(function(t) {
                            a.push(t.title), o.push(t.content);
                        }), e.setData({
                            title: a,
                            msgarr: o,
                            msg: o[0]
                        });
                    } else wx.showToast({
                        icon: "none",
                        title: s.msg,
                        duration: 1500
                    });
                }
            });
        },
        show: function(t) {
            var e = t.target.dataset.index;
            this.setData({
                msg: this.data.msgarr[e],
                showbox: !0
            });
        },
        msgboxclose: function() {
            this.setData({
                showbox: !1,
                msg: ""
            });
        }
    }
});